#ifndef COM_FORM_USER_H
#define COM_FORM_USER_H

#include <QWidget>

#include <QSqlQuery>
#include <QSqlQueryModel>
//#include <QStandardItemModel>
#include <QTimer>

namespace Ui {
class com_Form_user;
}

class com_Form_user : public QWidget
{
    Q_OBJECT

public:
    explicit com_Form_user(QWidget *parent = nullptr);
    ~com_Form_user();
    void closeEvent(QCloseEvent *event);

    void flush(int);  //0 用户列表， 1 界面所有数据

signals:
    void destroyW( QString );

private slots:
    void listCheckBoxChanged();
    void timer1out();
    void on_pushButton_clicked();

    void on_pbRoleSave_clicked();

    void on_pbRoleRemove_clicked();

    void on_lwRole_currentTextChanged(const QString &currentText);


    void on_tabWidget_currentChanged(int index);

    void on_tvUsers_clicked(const QModelIndex &index);

    void on_tvUsers_doubleClicked(const QModelIndex &index);

    void on_ckbValid_clicked();

    void on_pbUserSave_clicked();

    void on_pbUserNew_clicked();

    void on_tbAdd_clicked();

    void on_tbRemove_clicked();

private:
    Ui::com_Form_user *ui;

    QSqlQuery *qrm, *qro, *qrot;
    QString sq;
    QSqlQueryModel *mdUsers;
    //QStandardItemModel *mdRelated, *mdGroup;

    QStringList roleList,userList,deptList;
    QTimer *timer1;

};

#endif // COM_FORM_USER_H
